﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ClassLibrary1;

namespace OopProperty
{
    public class Program
    {
        static void Main(string[] args)
        {
            //Test1();
            Test5();
            Console.Read();
        }

        static void Test1()
        {

            People people = new People();
            people.PId = 1;
            people.Name = "Test";
            people.Description = "Description";
            people.ShowInfo();
        }

        static void Test2()
        {
            People people = new People();
            //people._age = 11; // 无法分配到只读字段
            // Console.WriteLine(people._age);
        }

        static void Test3()
        {
            People people = new People();
            people.Age = 101;
            Console.WriteLine(people.Age);
            People people1 = new People();
            people1.Age = 11;
            Console.WriteLine(people1.Age);
        }

        static void Test4() {
            People people = new People();
            Console.WriteLine(people.Name);  // 张三

            people.Name = "里斯";
            Console.WriteLine(people.Name);  //             里斯
        }

        static void Test5() { 
            
            Turbo ea888 = new Turbo();
            ea888.Type = "EA888";
            ea888.Volumn = 2.0f;
            Car audiA6 = new Car();
            audiA6.Brand = "audi";
            audiA6.CarTurbo = ea888;
            audiA6.ShowInfo();
            
        }

        static void Test6() {
            Class1 c1 = new Class1(); // Class1不可访问，一位内它具有一定的保护级别
        }
    }
}
